#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import word_blueprint
from api_1_0.wordResource.wordResource import WordResource
from api_1_0.wordResource.wordOtherResource import WordOtherResource

api = Api(word_blueprint)

api.add_resource(WordResource, '/<word_id>', '', endpoint='Word')


@word_blueprint.route('/update/<word_id>', methods=['PUT'], endpoint='WordUpdate')
def update(word_id):
    return WordOtherResource.sensitive_update(word_id)

# 获取下一个单词
@word_blueprint.route('/next-word/<plan_id>', methods=['GET'], endpoint='NextWord')
def next_word(plan_id):
    return WordOtherResource.next_word(plan_id)

# 标记单词为已掌握
@word_blueprint.route('/is_get/<word_id>', methods=['POST'], endpoint='MarkAsMastered')
def is_get(word_id):
    return WordOtherResource.is_get(word_id)